1. Field of the Invention
The present invention relates to a data processing system; more particularly, the present invention relates to a 8-8 and 2-4-8 inverse discrete cosine transform system having the advantages of high speed calculation and low cost of production, and the method thereof.
2. Description of the Prior Art
The DV format is the standard specification for recording a digital video by a video tape recorder. Specifications, such as the IEC 61834 and the SMPTE 314M . . . etc., have been extensively used on consumer electronic products (e.g. digital camcorders).
Conventional digital video comprises a series of frames. Each frame comprises a plurality of scanning lines and is played in order and in a specific speed, such as 30 frames per second. Each frame comprises a pair of fields, and usually the number of scanning lines of each field is half of the number of scanning lines in each frame.
The DV codec of the conventional DV format compresses digital data by the well-known discrete cosine transform (DCT) procedure. First, each frame is divided into N×N pixel blocks; usually N is equal to 8. Next, during the video recording procedure, the data (ah,u) of the pixel blocks in the time domain are transformed by the DCT procedure into DCT coefficients (yx,z) in the frequency domain.
Please refer to FIG. 1 for the conventional inverse discrete cosine transform (IDCT) procedure. FIG. 1 is a schematic diagram of the IDCT procedure. The input matrix (A) comprises eight rows by eight columns of DCT coefficients (ah,u), and it is sequentially indexed by the row index (h, h=0˜7) and the column index (u, u=0˜7). The output matrix (Y) comprises eight rows by eight columns of output data (yx,z), and it is sequentially indexed by the row index (x, x=0˜7) and the column index (z, z=0˜7). The input matrix (A) and the output matrix (Y) can be expressed as follows:
      A    =        ⁢          [                                                  a                              0                ,                0                                                                        a                              0                ,                1                                                                        a                              0                ,                2                                                                        a                              0                ,                3                                                                        a                              0                ,                4                                                                        a                              0                ,                5                                                                        a                              0                ,                6                                                                        a                              0                ,                7                                                                                        a                              1                ,                0                                                                        a                              1                ,                1                                                                        a                              1                ,                2                                                                        a                              1                ,                3                                                                        a                              1                ,                4                                                                        a                              1                ,                5                                                                        a                              1                ,                6                                                                        a                              1                ,                7                                                                                        a                              2                ,                0                                                                        a                              2                ,                1                                                                        a                              2                ,                2                                                                        a                              2                ,                3                                                                        a                              2                ,                4                                                                        a                              2                ,                5                                                                        a                              2                ,                6                                                                        a                              2                ,                7                                                                                        a                              3                ,                0                                                                        a                              3                ,                1                                                                        a                              3                ,                2                                                                        a                              3                ,                3                                                                        a                              3                ,                4                                                                        a                              3                ,                5                                                                        a                              3                ,                6                                                                        a                              3                ,                7                                                                                        a                              4                ,                0                                                                        a                              4                ,                1                                                                        a                              4                ,                2                                                                        a                              4                ,                3                                                                        a                              4                ,                4                                                                        a                              4                ,                5                                                                        a                              4                ,                6                                                                        a                              4                ,                7                                                                                        a                              5                ,                0                                                                        a                              5                ,                1                                                                        a                              5                ,                2                                                                        a                              5                ,                3                                                                        a                              5                ,                4                                                                        a                              5                ,                5                                                                        a                              5                ,                6                                                                        a                              5                ,                7                                                                                        a                              6                ,                0                                                                        a                              6                ,                1                                                                        a                              6                ,                2                                                                        a                              6                ,                3                                                                        a                              6                ,                4                                                                        a                              6                ,                6                                                                        a                              6                ,                6                                                                        a                              6                ,                7                                                                                        a                              7                ,                0                                                                        a                              7                ,                1                                                                        a                              7                ,                2                                                                        a                              7                ,                3                                                                        a                              7                ,                4                                                                        a                              7                ,                5                                                                        a                              7                ,                6                                                                        a                              7                ,                7                                                        ]        ,          ⁢      Y    =        ⁢                  [                                                            y                                  0                  ,                  0                                                                                    y                                  0                  ,                  1                                                                                    y                                  0                  ,                  2                                                                                    y                                  0                  ,                  3                                                                                    y                                  0                  ,                  4                                                                                    y                                  0                  ,                  5                                                                                    y                                  0                  ,                  6                                                                                    y                                  0                  ,                  7                                                                                                        y                                  1                  ,                  0                                                                                    y                                  1                  ,                  1                                                                                    y                                  1                  ,                  2                                                                                    y                                  1                  ,                  3                                                                                    y                                  1                  ,                  4                                                                                    y                                  1                  ,                  5                                                                                    y                                  1                  ,                  6                                                                                    y                                  1                  ,                  7                                                                                                        y                                  2                  ,                  0                                                                                    y                                  2                  ,                  1                                                                                    y                                  2                  ,                  2                                                                                    y                                  2                  ,                  3                                                                                    y                                  2                  ,                  4                                                                                    y                                  2                  ,                  5                                                                                    y                                  2                  ,                  6                                                                                    y                                  2                  ,                  7                                                                                                        y                                  3                  ,                  0                                                                                    y                                  3                  ,                  1                                                                                    y                                  3                  ,                  2                                                                                    y                                  3                  ,                  3                                                                                    y                                  3                  ,                  4                                                                                    y                                  3                  ,                  5                                                                                    y                                  3                  ,                  6                                                                                    y                                  3                  ,                  7                                                                                                        y                                  4                  ,                  0                                                                                    y                                  4                  ,                  1                                                                                    y                                  4                  ,                  2                                                                                    y                                  4                  ,                  3                                                                                    y                                  4                  ,                  4                                                                                    y                                  4                  ,                  5                                                                                    y                                  4                  ,                  6                                                                                    y                                  4                  ,                  7                                                                                                        y                                  5                  ,                  0                                                                                    y                                  5                  ,                  1                                                                                    y                                  5                  ,                  2                                                                                    y                                  5                  ,                  3                                                                                    y                                  5                  ,                  4                                                                                    y                                  5                  ,                  5                                                                                    y                                  5                  ,                  6                                                                                    y                                  5                  ,                  7                                                                                                        y                                  6                  ,                  0                                                                                    y                                  6                  ,                  1                                                                                    y                                  6                  ,                  2                                                                                    y                                  6                  ,                  3                                                                                    y                                  6                  ,                  4                                                                                    y                                  6                  ,                  6                                                                                    y                                  6                  ,                  6                                                                                    y                                  6                  ,                  7                                                                                                        y                                  7                  ,                  0                                                                                    y                                  7                  ,                  1                                                                                    y                                  7                  ,                  2                                                                                    y                                  7                  ,                  3                                                                                    y                                  7                  ,                  4                                                                                    y                                  7                  ,                  5                                                                                    y                                  7                  ,                  6                                                                                    y                                  7                  ,                  7                                                                    ]            .      
Conventional IDCT procedure transforms the DCT coefficients (ah,u) in the frequency domain, which are obtained by the DCT procedure, back to each element (yx,z) of the output matrix (Y) in the time domain by the IDCT formulae. In the specifications of the DV format, the DCT procedure can be distinguished into two kinds; one is the 8-8 DCT mode, and the other is the 2-4-8 DCT mode. The 8-8 DCT mode is often used to process situations which have smaller variations between neighboring fields, and the 2-4-8 DCT mode is used to process situations which have larger variations between neighboring fields.
In conventional DV codec, the digital data decompressing procedures are inversed in comparison with the compressing procedures. If the DV codec detects a data stream that originally has been compressed by 8-8 DCT, the DV codec will decompress the data stream by the 8-8 inverse discrete cosine transform (IDCT). If the DV codec detects a data stream that originally has been compressed by 2-4-8 DCT, the DV codec will decompress the data stream by the 2-4-8 IDCT.
If A is the 8-8 DCT input matrix, then Y is the 8-8 output matrix, each element (yx,z) of the output matrix (Y) will be calculated from the elements (ah,u) of the input matrix (A) through the following formulae:
      y          x      ,      z        =            ∑              h        =        0            7        ⁢                  ∑                  u          =          0                7            ⁢                        c          ⁡                      (            h            )                          ⁢                  c          ⁡                      (            u            )                          *                  a                      h            ,            u                          *                  COS          ⁡                      (                                                            (                                                            2                      ⁢                      x                                        +                    1                                    )                                16                            ⁢              h              ⁢                                                          ⁢              π                        )                          *                  COS          ⁡                      (                                                            (                                                            2                      ⁢                      z                                        +                    1                                    )                                16                            ⁢              u              ⁢                                                          ⁢              π                        )                              wherein
            c      ⁡              (        0        )              =          1              2        ⁢                  2                      ,c(n)=½, n is a natural number, and n=1˜7.
If A is the 2-4-8 DCT input matrix, then Y is the 2-4-8 output matrix, each element (yx,z) of the output matrix (Y) will be calculated from the elements (ah,u) of the input matrix (A) through the following formulae:
            y              x        ,                  2          ⁢          g                      =                  ∑                  h          =          0                7            ⁢                        ∑                      m            =            0                    3                ⁢                              c            ⁡                          (              h              )                                ⁢                      c            ⁡                          (              m              )                                *                      [                                          a                                  h                  ,                  m                                            +                              a                                  h                  ,                                      m                    +                    4                                                                        ]                    *                      COS            ⁡                          (                                                                    (                                                                  2                        ⁢                        x                                            +                      1                                        )                                    16                                ⁢                h                ⁢                                                                  ⁢                π                            )                                *                      COS            ⁡                          (                                                                    (                                                                  2                        ⁢                        g                                            +                      1                                        )                                    8                                ⁢                m                ⁢                                                                  ⁢                π                            )                                                      y              x        ,                              2            ⁢            g                    +          1                      =                  ∑                  h          =          0                7            ⁢                        ∑                      m            =            0                    3                ⁢                              c            ⁡                          (              h              )                                ⁢                      c            ⁡                          (              m              )                                *                      [                                          a                                  h                  ,                  m                                            -                              a                                  h                  ,                                      m                    +                    4                                                                        ]                    *                      COS            ⁡                          (                                                                    (                                                                  2                        ⁢                        x                                            +                      1                                        )                                    16                                ⁢                h                ⁢                                                                  ⁢                π                            )                                *                      COS            ⁡                          (                                                                    (                                                                  2                        ⁢                        g                                            +                      1                                        )                                    8                                ⁢                m                ⁢                                                                  ⁢                π                            )                                          wherein
            c      ⁡              (        0        )              =          1              2        ⁢                  2                      ,c(n)=½, n is a natural number, and n=1˜7; m and g are also natural numbers, and m=0˜3, g=0˜3.
Please refer to the U.S. Pat. No. 6,137,916 for detailed processes in which the DV codec compresses/decompresses DV format by the DCT/IDCT procedures.
Referring to FIG. 2, FIG. 2 is a schematic diagram which cumulatively sums up conventional partial output matrixes (Yh,u) to obtain the output matrix (Y). In the IDCT procedure shown in FIG. 1, the output matrix (Y) can be taken as the result of cumulatively summing up 64 partial output matrixes (Yh,u, h=0˜7, u=0˜7). Each partial output matrix (Yh,u) consists of 8 rows by 8 columns of 64 matrix elements in total. Each partial output matrix (Yh,u) represents the contributions to the output matrix (Y) after the calculation of the IDCT formulae is performed on an inputted DCT coefficient (ah,u, h=0˜7, u=0˜7) every time. For example, inputting a0,0, results in obtaining the 64 matrix elements of the partial output matrix (Y0,0); inputting a0,1, results in obtaining the 64 matrix elements of the partial output matrix (Y0,1). In this way, after inputting 64 DCT coefficients (ah,u) one by one, the corresponding 64 partial output matrixes (Yh,u) can be obtained. Finally, the 64 partial output matrixes (Yh,u) are summed up, and a complete output matrix (Y) can be obtained.
The prior arts, such as the U.S. Pat. No. 5,636,152 and the U.S. Pat. No. 5,825,420, perform the 8-8 IDCT through the procedures mentioned above. However, when prior arts cumulatively sum up a partial output matrix, a total of 64 adders are needed to perform 64 summations. Therefore, cumulatively summing up 64 partial output matrixes requires a total of 4096 summations to be performed. The 64 adders and the 4096 summations increase the cost of the system hardware and consume much power.
Besides, other prior art such as the U.S. Pat. No. 6,420,979 adapts the conventional method of row column decomposition. The method is used to divide a two-dimensional IDCT calculation into two one-dimension IDCT calculations; after 64 results of the first one-dimension IDCT calculation have been calculated, the second one-dimension IDCT calculation can be performed. Therefore, the conventional row column decomposition extends the decompression time, and a register memory, that can sufficiently store 64 temp values, is needed. Therefore, the cost of a DV codec is increased. Besides, when performing the IDCT procedure to 8-8 and 2-4-8 DCT coefficients, the prior arts use two separate 8-8 and 2-4-8 IDCT hardware to perform the 8-8 or 2-4-8 IDCT procedure respectively; however, this method again greatly increases the cost of hardware and decreases the usage efficiency of the hardware.
Therefore, the main objective of the present invention is to provide an inverse discrete cosine transform system, which has high speed calculation and low cost of production, and the method thereof, in order to solve the problems of prior arts.